package cn.gson.springboot.model.dao.saledao;

import cn.gson.springboot.model.pjos.Deliveryplan;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.criteria.CriteriaBuilder;
import java.util.List;

public interface DeliveryplanDao extends CrudRepository<Deliveryplan,Integer> {
//    根据客户id查询该客户的交付计划
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "select * from deliveryplan where de_customerid = ?1")
    public List<Deliveryplan> selectDeliveryplan(Integer congId);

//    合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update deliveryplan set de_customerid = ?1 where de_customerid = ?2")
    public void upCustomer(Integer daoId,Integer congId);
}
